package com.itheima.d3_enumdemo;

public class Test2 {
    public static void main(String[] args) {
    move(Direction.UP);
    move(Direction.DOWN);
    move(Direction.LEFT);
    move(Direction.RIGHT);
    }

    public static void move(Direction direction) {
        switch (direction) {
            case Direction.UP:
                System.out.println("向上移动");
                break;

            case Direction.DOWN:
                System.out.println("向下移动");
                break;

            case Direction.LEFT:
                System.out.println("向左移动");
                break;

            case Direction.RIGHT:
                System.out.println("向右移动");
        }
    }
}
